<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script src="js/jquery.js"></script>
<script>
$(document).ready(function()
		{
	  	     	
	$("#s1").click(function(){
		
		var path=$("#f1").val().split("\\");
		//alert(path);
		$("#file_name").val(path[path.length-1]);
		});
	});
	
</script>

 <script>
        window.onunload = refreshParent;
        function refreshParent() {
            window.opener.location.reload();
        }
    </script>
	
<body>
	<form action="imageuploader.action" method="post" enctype="multipart/form-data" >

<input type="hidden" id="file_name" name="file_name"/>

<table  align="center">
<tr>
<td>Add New Document</td>
<td><input type="file" id="f1" name="attached_file"/></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" id="s1" value="Upload Document"/></td></tr>
</table>

</form>
</body>

	</head>
	</html>